﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;

namespace SQT.tracnghiem.Ajax.ASP.Reports
{
    public partial class report_student_month : System.Web.UI.Page
    {
        public int early = 0, late = 0, absent_yes = 0, absent_no = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            int month = int.Parse(Request.QueryString["month"]);
            int year = int.Parse(Request.QueryString["year"]);

            foreach (TblCheckUser chk_user in new TblCheckUserController().FetchAll().Where(x => DateTime.Parse(x.DateX.ToString()).Month == month && DateTime.Parse(x.DateX.ToString()).Year == year))
            {
                if (chk_user.Early == true)
                    early++;
                if (chk_user.Late == true)
                    late++;
                if (chk_user.AbsentYes == true)
                    absent_yes++;
                if (chk_user.AbsentNo == true)
                    absent_no++;
            }
        }
    }
}